# Maintainer: Ivan Semkin (ivan at semkin dot ru)

pkgname=libusermetrics-git
_pkgname=libusermetrics
pkgver=r477.a50ce9f
pkgrel=3
pkgdesc='Library for exporting anonymous metrics about users'
url='https://github.com/ubports/libusermetrics'
arch=(x86_64 i686 armv7h aarch64)
license=(LGPL3 LGPL GPL)
conflicts=(libusermetrics)
provides=(libusermetrics)
depends=(qt5-base qt5-xmlpatterns gsettings-qt apparmor click-git qdjango-git libqtdbustest-git)
makedepends=(git cmake cmake-extras-git doxygen intltool)
source=('git+https://github.com/ubports/libusermetrics.git')
sha256sums=('SKIP')

BUILDENV+=('!check') # Some tests are broken

pkgver() {
  cd ${_pkgname}
  echo "r$(git rev-list --count HEAD).$(git describe --always)"
}

prepare() {
  cd ${_pkgname}
  git checkout bionic
}

build() {
  cd ${_pkgname}
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR="lib/" -DCMAKE_INSTALL_LIBEXECDIR="lib/" .
  make
}

check() {
  cd ${_pkgname}
  make ARGS+="--output-on-failure" test
}

package() {
  cd ${_pkgname}
  make DESTDIR="${pkgdir}/" install
}
# vim:set ts=2 sw=2 et:
